package cn.ycc1.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
@Api(tags = "用户管理接口")
public class UserController {

    @GetMapping("/{id}")
    @ApiOperation(value = "根据ID获取用户", notes = "根据用户ID获取用户详细信息")
    public String getUserById(@PathVariable Long id) {
        return "User " + id;
    }

    @PostMapping
    @ApiOperation("创建用户")
    public String createUser(@RequestBody String user) {
        return "User created: " + user;
    }
}
